package cn.bone.ou.data.controller;

import cn.bone.base.bean.CommonResult;
import cn.bone.ou.data.service.IArticleService;
import cn.bone.ou.data.param.ArticleParam;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RequestMapping("/ou/article")
@RestController
public class ArticleController {

    @Resource
    private IArticleService articleService;

    @RequestMapping("/list")
    public CommonResult list(@Valid ArticleParam.ListParam param){
        return articleService.list(param);
    }

    @RequestMapping("/add")
    public CommonResult add(@Valid ArticleParam.AddParam param){
        return articleService.add(param);
    }

    @RequestMapping("/modify")
    public CommonResult modify(@Valid ArticleParam.ModifyParam param){
        return articleService.modify(param);
    }

    @RequestMapping("/detail")
    public CommonResult detail(@Valid ArticleParam.DeleteParam param){
        return articleService.detail(param);
    }

    @RequestMapping("/delete")
    public CommonResult delete(@Valid ArticleParam.DeleteParam param){
        return articleService.delete(param);
    }
}
